#ifndef H_APPSETTINGS_H
#define H_APPSETTINGS_H

#include <QSettings>

// using pattern Singleton
class ApplicationSettings {

public:

    static ApplicationSettings* getInstance() {
        if(!instance)
            instance = new ApplicationSettings();
        return instance;
    }

    QString getSettingProperty(const QString &group,
                               const QString &setting_property);

    void setRegGroupCompany(QString name);
    void setRegGroupApplication(QString name);
    void setRegGroupProperties(QString regGroupCompany,
                               QString regGroupApplication);

    void setSettingProperty(const QString &group,
                            const QString &property,
                            QVariant val);

    bool getBoolProperty(const QString &group,
                         const QString &property);

private:
    ApplicationSettings();
    ApplicationSettings(const ApplicationSettings& );
    ApplicationSettings& operator=(const ApplicationSettings& );

    ~ApplicationSettings();

    QSettings *appSettings;

    QString REG_GROUP_COMPANY;
    QString REG_GROUP_APPLICATION;

    static ApplicationSettings* instance;

};

#endif
